﻿using Core.Tenant.Abstractions;
using Core.Tenant.Dtos;
using MediatR;

namespace Core.Tenant.Features.GetTenantByName;

public sealed class GetTenantByNameHandler(ITenantService service) : IRequestHandler<GetTenantByNameQuery, TenantResponse>
{
    public async Task<TenantResponse> Handle(GetTenantByNameQuery request, CancellationToken cancellationToken)
    {
        return await service.GetByNameAsync(request.TenantName);
    }
}
